#ifndef KBMOUSE_H
#define KBMOUSE_H

#include <QApplication>
#include <QWidget>
#include <QGridLayout>
#include <QLabel>
#include <QToolButton>
#include <QDebug>

#define CapsLock "Caps"
#define CtrlKey  "Ctrl"
#define AltKey   "Alt"
#define ShiftKey "Shift"

class KbMouse;

class Keytype : public QToolButton
{
    Q_OBJECT
public:
    Keytype(KbMouse *parent, QString lower, QString upper, int ctrl, int alt, int width = 0);

public slots:
    void keyclick();
    void capslock(bool on);

signals:
    void keyclick(Keytype *type);

public:
    bool capslocked;
    bool caps;
    QString lowerCase;
    QString upperCase;
    int ctrlValue;
    int altValue;
};

class KbMouse : public QWidget
{
    Q_OBJECT
public:
    KbMouse(QWidget *parent = 0);
    ~KbMouse();

private:
    Keytype *findKey(QString name);
    void clearShiftKey();
    void clearAltKey();
    void clearCtrlKey();

public slots:
    void keyclick(Keytype *type);

private:
    QGridLayout layout;
    bool shiftPressed;
    bool altPressed;
    bool ctrlPressed;
};

#endif // KBMOUSE_H
